package com.macaline.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

@ApiModel
@TableName(value = "user")
public class User implements Serializable{

	public final static Integer ADMIN_ROLE_ID = 1;

	// 标注数据表中主键字段名称，和主键策略
	@JsonIgnore
	@ApiModelProperty(hidden = true)
	@TableId(value = "id", type = IdType.AUTO)
	private Integer id;

	@ApiModelProperty(value = "用户登录名称")
	private String userName;

	@JsonIgnore
	@ApiModelProperty(value = "用户加密密码时使用的盐",hidden = true)
	private String salt;

	@ApiModelProperty(value = "用户登录密码")
	private String passWord;

	@JsonIgnore
	@ApiModelProperty(value = "用户的注册时间",hidden = true)
	private Integer regTime;

	@ApiModelProperty(value = "用户角色id。1：管理员；2：普通用户")
	private Integer roleId;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getPassWord() {
		return passWord;
	}

	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}

	public Integer getRegTime() {
		return regTime;
	}

	public void setRegTime(Integer regTime) {
		this.regTime = regTime;
	}

	public Integer getRoleId() {
		return roleId;
	}

	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}

	@Override
	public String toString() {
		return "User{" +
				"id=" + id +
				", userName='" + userName + '\'' +
				", salt='" + salt + '\'' +
				", passWord='" + passWord + '\'' +
				", regTime=" + regTime +
				", roleId=" + roleId +
				'}';
	}
}
